package ws.very.util.lang

import scala.annotation.elidable, elidable._

trait ReturnSelfTrait {
  def rethis[R](fn: => R): this.type = {
    fn
    this
  }
}

trait IsThreadHolding {
  @elidable(ASSERTION)
  @inline
  def assertThreadHolding: Unit = {}
}
trait IsThreadHoldingImpl extends IsThreadHolding {
  @elidable(ASSERTION)
  @inline
  override def assertThreadHolding: Unit =
    assert(Thread.holdsLock(this))
}